home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / OLE2BOOK.ZIP / CHAP08.ZIP / CHAP08 / SCHMOO / MAKEFILE < prev    next >
Text File  |  1993-06-22  |  4KB  |  147 lines

  1. #
  2. # MAKEFILE
  3. # Schmoo version 2.0 Chapter 8
  4. #
  5. # Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  6. #
  7. # Kraig Brockschmidt, Software Design Engineer
  8. # Microsoft Systems Developer Relations
  9. #
  10. # Internet  :  kraigb@microsoft.com
  11. # Compuserve:  >INTERNET:kraigb@microsoft.com
  12. #
  13.  
  14. #Add '#' to the next line for 'noisy' operation
  15. !CMDSWITCHES +s
  16.  
  17. #
  18. #Compiler flags
  19. #Use "SET RETAIL=1" from MS-DOS to compile non-debug version.
  20. #
  21. !ifndef RETAIL
  22. CFLAGS  = -c -nologo -Od -AM -Zipe -G2s -W3 -GA -GEs
  23. LINK    = /al:16/ONERROR:NOEXE/CO
  24. DEFS    = -DSTRICT -DDEBUG
  25. !else
  26. CFLAGS  = -c -nologo -Oas -AM -Zpe -G2s -W3 -GA -GEs
  27. LINK    = /al:16/ONERROR:NOEXE
  28. DEFS    = -DSTRICT
  29. !endif
  30.  
  31.  
  32. !ifdef SDI
  33. DOC     = -DSDI
  34. CLASSLIB= classSDI
  35. DIR     = SDI
  36. SRC_DIR = ..
  37. !else
  38. DOC     = -DMDI
  39. CLASSLIB= classMDI
  40. DIR     = MDI
  41. SRC_DIR = ..
  42. !endif
  43.  
  44.  
  45. .SUFFIXES: .h .obj .exe .cpp .res .rc
  46.  
  47. TARGET  = schmoo
  48.  
  49. goal:   cd_build precomp.pch $(TARGET).exe cd_src
  50.  
  51. cd_build:
  52.     cd $(DIR)
  53.  
  54. cd_src:
  55.     cd ..
  56.  
  57. clean:
  58.     cd $(DIR)
  59.     del *.pch
  60.     del *.obj
  61.     del *.res
  62.     del *.exe
  63.     cd ..
  64.  
  65.  
  66. PCHFLAGS= -Yu$(TARGET).h -Fpprecomp.pch
  67.  
  68. INCLS    = $(SRC_DIR)\$(TARGET).h $(SRC_DIR)\resource.h
  69. OLELIBS  = compobj storage ole2
  70. LIBS     = libw mlibcew commdlg bttncur gizmobar stastrip $(CLASSLIB)
  71.  
  72. OBJS1    = $(TARGET).obj client.obj
  73. OBJS2    = document.obj polyline.obj polywin.obj
  74. OBJS3    = idropsrc.obj idroptgt.obj
  75. OBJS     = $(OBJS1) $(OBJS2) $(OBJS3)
  76.  
  77. RCFILES1 = $(SRC_DIR)\$(TARGET).ico $(SRC_DIR)\document.ico $(SRC_DIR)\about.dlg
  78. RCFILES2 = $(SRC_DIR)\gizmo72.bmp $(SRC_DIR)\gizmo96.bmp $(SRC_DIR)\gizmo120.bmp
  79. RCFILES  = $(RCFILES1) $(RCFILES2)
  80.  
  81.  
  82. #####
  83.  
  84. {$(SRC_DIR)}.cpp{}.obj:
  85.     echo ++++++++++
  86.     echo Compiling $*.cpp
  87.     cl $(CFLAGS) $(PCHFLAGS) $(DEFS) $(DOC) $(SRC_DIR)\$*.cpp
  88.  
  89.  
  90. {$(SRC_DIR)}.rc{}.res:
  91.     echo +++++++++
  92.     echo Compiling Resources
  93.     rc -r -i$(SRC_DIR) $(DEFS) $(DOC) -fo$@ $(SRC_DIR)\$*.rc
  94.  
  95.  
  96. precomp.pch : $(SRC_DIR)\$(TARGET).h $(SRC_DIR)\polyline.h
  97.     echo +++++++++
  98.     echo Precompiling $(TARGET).h
  99.     cl $(CFLAGS) $(DEFS) -Yc$(TARGET).h -Fpprecomp.pch -Foprecomp $(SRC_DIR)\precomp.cpp
  100.  
  101.  
  102. #This rule builds a linker response file on the fly depending on debug flags
  103. $(TARGET).exe : $(OBJS) $(TARGET).res $(SRC_DIR)\$(TARGET).def
  104.     echo ++++++++++
  105.     echo Linking $@
  106.     echo precomp.obj +                           > $(TARGET).lrf
  107.     echo $(OBJS1) +                             >> $(TARGET).lrf
  108.     echo $(OBJS2) +                             >> $(TARGET).lrf
  109.     echo $(OBJS3)                               >> $(TARGET).lrf
  110.  
  111.     echo $(TARGET).exe $(LINK)                  >> $(TARGET).lrf
  112.     echo nul/li                                 >> $(TARGET).lrf
  113.     echo $(OLELIBS) +                           >> $(TARGET).lrf
  114.     echo $(LIBS) /NOD/NOE                       >> $(TARGET).lrf
  115.     echo $(SRC_DIR)\$(TARGET).def               >> $(TARGET).lrf
  116.  
  117.     link @$(TARGET).lrf
  118.     del $(TARGET).lrf
  119.     rc -v $(TARGET).res $(TARGET).exe
  120.  
  121.  
  122. ##### Dependencies #####
  123.  
  124. $(TARGET).res : $(SRC_DIR)\$(TARGET).rc $(INCLS) $(RCFILES)
  125.  
  126. #Application level things
  127.  
  128. #The file that does #define INITGUIDS should not use precompiled headers.
  129. $(TARGET).obj : $(SRC_DIR)\$(TARGET).cpp   $(INCLS)
  130.     echo ++++++++++
  131.     echo Compiling $*.cpp
  132.     cl $(CFLAGS) $(DEFS) $(DOC) $(SRC_DIR)\$*.cpp
  133.  
  134. client.obj    : $(SRC_DIR)\client.cpp   $(INCLS)
  135.  
  136. #Document level things
  137. document.obj  : $(SRC_DIR)\document.cpp $(INCLS) $(SRC_DIR)\polyline.h
  138.  
  139.  
  140. idropsrc.obj  : $(SRC_DIR)\idropsrc.cpp $(INCLS)
  141. idroptgt.obj  : $(SRC_DIR)\idroptgt.cpp $(INCLS)
  142.  
  143.  
  144. #Editor level things
  145. polyline.obj  : $(SRC_DIR)\polyline.cpp $(INCLS) $(SRC_DIR)\polyline.h
  146. polywin.obj   : $(SRC_DIR)\polywin.cpp  $(INCLS) $(SRC_DIR)\polyline.h
  147.